﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using YArchitech.LIB;

namespace YArchitech.Controls
{
	public partial class HYProgressBar : System.Windows.Forms.Form
	{
		public HYProgressBar()
		{
			this.InitializeComponent();
			new HYProcessTools().ShowInTaskbarChange(this);
		}

		public int TotalTime
		{
			set
			{
				this.iTotal = value * 1000;
			}
		}

		private void HYProgressBar_Load(object sender, EventArgs e)
		{
			this.progressBar1.Maximum = this.iTotal;
			this.timer1.Start();
		}

		private void timer1_Tick(object sender, EventArgs e)
		{
			if (this.iStep > this.iTotal)
			{
				base.Close();
				return;
			}
			this.progressBar1.Value = this.iStep;
			this.iStep += 100;
		}

		private int iTotal = 3000;

		private int iStep = 100;
	}
}
